def formatParam(data: dict | list[dict], remove=None, need=None) -> dict or [dict]:
    if remove is None:
        remove = list()
    if need is None:
        need = list()
    if type(data) == dict:
        if len(need) > 0:
            data = {key: value for key, value in data.items() if ((key not in remove) and (key in need))}
        else:
            data = {key: value for key, value in data.items() if key not in remove}
        return data
    elif type(data) == list:
        if len(need) > 0:
            data = [{key: value for key, value in item.items() if ((key not in remove) and (key in need))} for item in
                    data]
        else:
            data = [{key: value for key, value in item.items() if key not in remove} for item in data]
        return data


def authParam(data: any, required: list[any]):
    if data is None:
        return True
    return data in required
